import request from '@/utils/request'

export function getAllcheckType() {
  return request({
    url: '/CheckType/selectAll',
    method: 'get'
  })
}
export function updatecheckType(checkType) {
  return request({
    url: '/CheckType/updateByPrimaryKeySelective',
    method: 'put',
    params: {
      checkAttendanceId: checkType.checkAttendanceId,
      checkTypeId: checkType.checkTypeId, // 考勤类型编号
      checkName: checkType.checkName, // 考勤类型名称
      checkScoreType: checkType.checkScoreType, // 考勤分数类型（1遵循考勤分数，2自定义分数）
      checkTypeScore: checkType.checkTypeScore // 考勤类型推荐分数（-99999：与正常考勤分数一致）
    }
  })
}

export function deletecheckType(checkTypeId) {
  return request({
    url: '/CheckType/deleteByPrimaryKey',
    method: 'post',
    params: {
      checkTypeId: checkTypeId
    }
  })
}

export function getcheckTypeById(checkTypeId) {
  return request({
    url: '/CheckType/selectById',
    method: 'get',
    params: {
      checkTypeId: checkTypeId
    }
  })
}

export function addAttendance(checkType) {
  return request({
    url: '/CheckType/insertSelective',
    method: 'post',
    params: {
      checkAttendanceId: checkType.checkAttendanceId,
      checkTypeId: checkType.checkTypeId, // 考勤类型编号
      checkName: checkType.checkName, // 考勤类型名称
      checkScoreType: checkType.checkScoreType, // 考勤分数类型（1遵循考勤分数，2自定义分数）
      checkTypeScore: checkType.checkTypeScore // 考勤类型推荐分数（-99999：与正常考勤分数一致）
    }
  })
}

export function getCheckTypeByCheckId(checkId) {
  return request({
    url: '/CheckType/selectByCAId',
    method: 'get',
    params: {
      checkAttendanceId: checkId
    }
  })
}

